package cn.javass.dp.decorator.example4;

public class Client {
    public static void main(String[] args) {
        //先创建计算基本奖金的类    也是被装饰的对象
        Component c = new ConcreteComponent();

        //组合普通业务人员奖金计算

        Decorator d1 = new MonthPrizeDecorator(c);
        Decorator d2 = new SumPrizeDecorator(d1);

        Decorator result = new SumPrizeDecorator(
                new MonthPrizeDecorator(
                    new ConcreteComponent()
        ));

        double zs = d2.calcPrize("张三" , null , null);
        System.out.println("张三的奖金：" + zs);

        double ls = d2.calcPrize("李四", null, null);
        System.out.println("李四的奖金 = " + ls);


        Decorator d3 = new GroupPrizeDecorator(d2);
        double ww = d3.calcPrize("王五", null, null);
        System.out.println("王五的奖金 = " + ww);
    }
}
